package com.cloud.auth.util;

import org.springframework.util.DigestUtils;

/**
 * @packageName: com.api.util
 * @name: TokenUtil
 * @description:
 * @author: 董定卓
 * @dateTime: 2019/6/26 14:45
 */
public class TokenUtil {

    public static String generate(String... strings) {
        long timestamp = System.currentTimeMillis();
        String tokenMeta = "";
        for (String s : strings) {
            tokenMeta = tokenMeta + s;
        }
        tokenMeta = tokenMeta + timestamp;
        return DigestUtils.md5DigestAsHex(tokenMeta.getBytes());
    }

}
